
import 'package:gluz/generated/json/base/json_field.dart';

import '../../generated/json/api_response.g.dart';

@JsonSerializable()
class ApiResponse {

  int code = 0;
  String msg = "";
  dynamic data;
  dynamic records;
  bool get success {
    return code == 200;
  }

  ApiResponse({this.data, this.code = 0, this.msg = ''});


  @override
  String toString() {
    return 'ApiResponse{code: $code, msg: $msg, data: $data, success: $success}';
  }

  factory ApiResponse.fromJson(
      Map<String, dynamic> json,
      ) =>
      $ApiResponseFromJson(json);

  Map<String, dynamic> toJson() =>
      $ApiResponseToJson(this);
}
